package com.ykh.mybbsdemo.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ykh.mybbsdemo.dao.mapper.VideoCategoryMapper;
import com.ykh.mybbsdemo.dao.pojo.po.VideoCategory;
import com.ykh.mybbsdemo.service.VideoCategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2023-11-03
 * Time: 13:21
 */
@Service
@Slf4j
public class VideoCategoryImpl extends ServiceImpl<VideoCategoryMapper, VideoCategory> implements VideoCategoryService {

    @Autowired
    VideoCategoryMapper videoCategoryMapper;

    @Override
    public VideoCategory findCategoryById(Long categoryId) {
        return videoCategoryMapper.selectById(categoryId);
    }

    @Override
    public List<VideoCategory> findAll() {
        LambdaQueryWrapper<VideoCategory> queryWrapper = new LambdaQueryWrapper<>();
        return videoCategoryMapper.selectList(queryWrapper);
    }
}
